import api from '@/api'
import { isCode } from '@/utils'
const initState = () => {
    return {
        retrieveData: {
            isShow: false, //是否显示弹窗
            cardTransition: "",
            title: "Retrieve Your Password", //弹窗标题
            btn: "next", //按钮文字
            desc: "Please enter the email address associated with your Enchi.io account.",
            email: {
                //邮箱
                title: "Email address: ", //输入框标题
                placeholder: "Enter email", //输入框默认提示
                tip: "Please enter an valid email address.Email address not yet registered.", //错误提示
                value: "", //输入框的值
                name: "email", //正则名称
            },
        }
    };
};

const state = initState();

const mutations = {
    //打开忘记密码弹窗
    openRetrievePop(state, type) {
        state.retrieveData.isShow = true;
        state.retrieveData.cardTransition = type ? type : 'contentEnterBottom';
    },
    //关闭忘记密码弹窗
    closeRetrievePop(state, type) {
        state.retrieveData.cardTransition = type ? type : 'contentEnterRotate';
        state.retrieveData.isShow = false;
        setTimeout(() => {
            this.commit('retrieve/resetState');
        });
    },
    resetState(state) {
        Object.assign(state, initState());
    }
};

const actions = {

};

const getters = {};

export default {
    namespaced: true,
    state,
    getters,
    mutations,
    actions
};